package tq.com.tqcom.net;

import java.util.ArrayList;

public class TQPictureUpload {

    static private String fileServer;
    static public void setFileServer(String str){

    }

    static public void uploadPicture(String file, INetCallback pNetCallback){
        TQNetClient.getShareClient().post("/api/user/file/new", file, null, pNetCallback);
    }


    public interface IPictureUploadListener{
        void finish(int index, INetCallback pNetCallback);
    }

    static public String downloadPath(String url){
        String full = String.format("/api/user/file/whoisyourdaddy/%s", url);
        return TQNetClient.getShareClient().fullUrl(full);
    }

    static public String uploadResult(TQNetResult pCallback){
        if(pCallback == null || !pCallback.isSuccess()
                || pCallback.getData() == null) return null;

        String id = pCallback.getData().optString("fid");
        return id;
    }
}
